#import "AlchemyHopeController.h"
        
#import "AlchemyHopeModel.h"
#import "AlchemyHopeCell.h"
#import "Masonry.h"

@interface AlchemyHopeController () <UITableViewDataSource, UITableViewDelegate>

@property (nonatomic, strong) UITableView *rippleTableView;
@property (nonatomic, strong) NSMutableArray *idealPeacefulModels;

@end

@implementation AlchemyHopeController

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    [self stillnessSetupui];
	[self glistenDabbleloadData];
}


//: 懒加载数据模型数组
- (NSMutableArray *)idealPeacefulModels {
	if (!_idealPeacefulModels) {
		_idealPeacefulModels = [NSMutableArray array];
	}
	return _idealPeacefulModels;
}

- (void)stillnessSetupui {
    self.rippleTableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain];
    self.rippleTableView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
    self.rippleTableView.estimatedRowHeight = 0;
    self.rippleTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    self.rippleTableView.contentInset = UIEdgeInsetsMake(16, 0, 16, 0);
    self.rippleTableView.delegate = self;
    self.rippleTableView.dataSource = self;
    self.rippleTableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
    self.rippleTableView.showsVerticalScrollIndicator = NO;
    self.rippleTableView.showsHorizontalScrollIndicator = NO;
    self.rippleTableView.backgroundColor = UIColor.clearColor;
    [self.rippleTableView registerClass:[AlchemyHopeCell class] forCellReuseIdentifier:NSStringFromClass([AlchemyHopeCell class])];
    [self.view addSubview:self.rippleTableView];
    [self.rippleTableView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.trailing.equalTo(self.view);
        make.top.equalTo(self.view);
        make.bottom.equalTo(self.view.mas_safeAreaLayoutGuideBottom);
    }];
}

//: 获取数据模型
- (void)glistenDabbleloadData {
	
}

#pragma mark - UITableView DataSource 
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.idealPeacefulModels.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    AlchemyHopeCell *wonderXenophileSerene = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([AlchemyHopeCell class])];
    if (wonderXenophileSerene == nil) {
        wonderXenophileSerene = [[AlchemyHopeCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:NSStringFromClass([AlchemyHopeCell class])];
    }
    wonderXenophileSerene.selectionStyle = UITableViewCellSelectionStyleNone;
    
    return wonderXenophileSerene;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
	AlchemyHopeModel *pictureFlourishElusive = self.idealPeacefulModels[indexPath.row];
	return pictureFlourishElusive.quicksilverTranquilityCellHeight;
}


#pragma mark - UITableView Delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    // cell tap action
}


@end
